<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--jstl을 쓰기 위해 사용 --%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><%--숫자 포맷을 사용하기 위해 사용 --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%><%--함수들을 이용하기 위해 사용 --%>   
<%@ taglib prefix="c-rt" uri="http://java.sun.com/jstl/core_rt" %>  <%-- ie버전 확인에 쓰기 위해 씀 --%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>마감관리</title>
<link href="reset.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<!--말 줄임 css(모든 브라우저 적용)-->
<style type="text/css">
.ellipsis{
	white-space:nowrap;
	text-overflow:ellipsis;		/* IE, Safari */
	-o-text-overflow:ellipsis;		/* Opera under 10.7 */
	overflow:hidden;			/* "overflow" value must be different from "visible" */ 
	-moz-binding: url('ellipsis.xml#ellipsis');
}
</style>

<script type="text/javascript" src="script/sms_util_script.js"></script>
<script type="text/javascript" src="script/sms_riskI_script.js"></script>
<script type="text/javascript" src="script/sms_riskI_ajax_script.js"></script>
<script type="text/javascript">
function winClose(){
	window.close();
}
</script>
</head>
<body>

<c:if test="${sessionScope.USER_ID==null}">
		<script type="text/javascript">
			alert("연결이 끊어졌습니다. 다시 로그인 해주시기 바랍니다");
			window.close();
		</script>	
</c:if>
<div class="box">
		<h4 class="white">
		<c:choose>
			<c:when test="${param.num==0}">
				정보식별및평가
			</c:when>
			<c:when test="${param.num==1}">
				자산식별및평가
			</c:when>
			<c:when test="${param.num==2}">
				위험식별
			</c:when>
			<c:when test="${param.num==3}">
				취약성 평가
			</c:when>
			<c:when test="${param.num==4}">
				위험수준평가
			</c:when>
			<c:when test="${param.num==5}">
				RTP수립
			</c:when>
			<c:when test="${param.num==6}">
				잔여위험평가
			</c:when>
		</c:choose>
		 마감
		</h4>
        <div class="box-container1">     		
        <form action="riskIAction.do" method="post" name="mtkind">
			<input type="hidden" name="mode" value="openMagam_insert"></input>
			<input type="hidden" name="pro_id" id="pro_id" value="${sessionScope.lastProId }"></input>
        	<table class="table-short1" style="margin: 0 auto; width: 420px">
      			<tfoot>
      				<tr>
      					<td>
                        	<div class="align-right">
                        		<a href="#" class="button" onclick="javascript: winClose()"><span>닫기</span></a>
                        	</div>
                        </td>
      				</tr>
      				<tr><td class="spaceLine"></td></tr>
      			</tfoot>
      		</table>
      		<table class="table-short1" style="margin: 0 auto; width: 420px">
      			<colgroup>
      				<col width="140px"/>
					<col width="60px"/>
					<col width="60px"/>
					<col width=""/>
				</colgroup>
      			<thead>
      				<tr>
      					<td style="padding-left: 10px">구분</td>
      					<td>처리완료</td>
      					<td>처리대상</td>
      					<td style="text-align: center;">마감</td>
					</tr>
      			</thead>
      		</table>
      		<div  class="scrollDIV" style="width: 420px; height: 190px;">
      		<table class="table-short1" style="margin: 0 auto; width: 420px">
      			<colgroup>
      				<col width="140px"/>
					<col width="60px"/>
					<col width="60px"/>
					<col width=""/>
				</colgroup>
      			<tbody>
      				<c:choose>
                    	<c:when test="${fn:length(list)!= 0}">
                       	<c:forEach var="list" items="${requestScope.list}" varStatus="status" begin="${param.num}" end="${param.num}">
                   			<%--
                   			<tr onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');" class="odd">
                   			 --%>
                   			 <tr <c:if test="${status.index%2==0 }">class="odd"</c:if> onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');">
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="${list.gun }">${list.gun }</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="${list.cnt1 }">${list.cnt1 }</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="${list.cnt2 }">${list.cnt2 }</div>
                    			</td>
                    			<td style="text-align: center;">
                    			<c:choose>
                    				<c:when test="${list.cnt1==list.cnt2 && status.index==0}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_apply(${list.no }, 'Y')"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${list.cnt1==list.cnt2 && status.index==1 && requestScope.list[0].cnt1==requestScope.list[0].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_apply(${list.no }, 'Y')"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${list.cnt1==list.cnt2 && status.index==2 && requestScope.list[0].cnt1==requestScope.list[0].cnt2 && requestScope.list[1].cnt1==requestScope.list[1].cnt2 }">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_apply(${list.no }, 'Y')"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${list.cnt1==list.cnt2 && status.index==3 && requestScope.list[0].cnt1==requestScope.list[0].cnt2 && requestScope.list[1].cnt1==requestScope.list[1].cnt2 && requestScope.list[2].cnt1==requestScope.list[2].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_apply(${list.no }, 'Y')"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${list.cnt1==list.cnt2 && status.index==4 && requestScope.list[0].cnt1==requestScope.list[0].cnt2 && requestScope.list[1].cnt1==requestScope.list[1].cnt2 && requestScope.list[2].cnt1==requestScope.list[2].cnt2 && requestScope.list[3].cnt1==requestScope.list[3].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_apply(${list.no }, 'Y')"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${list.cnt1==list.cnt2 && status.index==5 && requestScope.list[0].cnt1==requestScope.list[0].cnt2 && requestScope.list[1].cnt1==requestScope.list[1].cnt2 && requestScope.list[2].cnt1==requestScope.list[2].cnt2 && requestScope.list[3].cnt1==requestScope.list[3].cnt2 && requestScope.list[4].cnt1==requestScope.list[4].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_apply(${list.no }, 'Y')"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${list.cnt1==list.cnt2 && status.index==6 && requestScope.list[0].cnt1==requestScope.list[0].cnt2 && requestScope.list[1].cnt1==requestScope.list[1].cnt2 && requestScope.list[2].cnt1==requestScope.list[2].cnt2 && requestScope.list[3].cnt1==requestScope.list[3].cnt2 && requestScope.list[4].cnt1==requestScope.list[4].cnt2 && requestScope.list[5].cnt1==requestScope.list[5].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_apply(${list.no }, 'Y')"><span>마감</span></a>
                    				</c:when>
                    				
                    				<%-- 마감 불가 메세지 --%>
                    				<c:when test="${requestScope.list[0].cnt1!=requestScope.list[0].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_errorMesseage(0,${param.num})"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${requestScope.list[1].cnt1!=requestScope.list[1].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_errorMesseage(1,${param.num})"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${requestScope.list[2].cnt1!=requestScope.list[2].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_errorMesseage(2,${param.num})"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${requestScope.list[3].cnt1!=requestScope.list[3].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_errorMesseage(3,${param.num})"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${requestScope.list[4].cnt1!=requestScope.list[4].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_errorMesseage(4,${param.num})"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${requestScope.list[5].cnt1!=requestScope.list[5].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_errorMesseage(5,${param.num})"><span>마감</span></a>
                    				</c:when>
                    				<c:when test="${requestScope.list[6].cnt1!=requestScope.list[6].cnt2}">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_errorMesseage(6,${param.num})"><span>마감</span></a>
                    				</c:when>
                    				
                    				<c:otherwise>
                    					<a href="#" class="button addMargin" style="margin: 0" onclick="magam_errorMesseage(7,7)"><span>마감</span></a>
                    				</c:otherwise>
                    			</c:choose>
                    			
                    				 <a href="#" class="button " style="margin: 0 0 0 5px" onclick="magam_apply(${list.no }, 'N')"><span>취소</span></a>
                    			</td>
                    		</tr>
                    		
                    		<%--
                    		<tr>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">자산평가</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">0</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">10</div>
                    			</td>
                    			<td style="text-align: center;">
                    					<a href="#" class="button" style="margin: 0" onclick="magam_apply(2, 'Y')"><span>적용</span></a>
                    				<c:if test="${sessionScope.mvo.memberType=='Y' }">
                    					<a href="#" class="button " style="margin: 0 0 0 5px" onclick="magam_apply(2, 'N')"><span>취소</span></a>
                    				</c:if>
                    			</td>
                    		</tr>
                    		
                    		
                    		<tr class="odd">
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">위험식별</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">0</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">10</div>
                    			</td>
                    			<td style="text-align: center;">
                    					<a href="#" class="button" style="margin: 0" onclick=""><span>적용</span></a>
                    				<c:if test="${sessionScope.mvo.memberType=='Y' }">
                    					<a href="#" class="button " style="margin: 0 0 0 5px" onclick=""><span>취소</span></a>
                    				</c:if>
                    			</td>
                    		</tr>
                    		
                    		
                    		<tr>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">취약성평가</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">0</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">10</div>
                    			</td>
                    			<td style="text-align: center;">
                    					<a href="#" class="button" style="margin: 0" onclick=""><span>적용</span></a>
                    				<c:if test="${sessionScope.mvo.memberType=='Y' }">
                    					<a href="#" class="button " style="margin: 0 0 0 5px" onclick=""><span>취소</span></a>
                    				</c:if>
                    			</td>
                    		</tr>
                    		
                    		<tr class="odd">
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">위험수준평가</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">0</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">10</div>
                    			</td>
                    			<td style="text-align: center;">
                    					<a href="#" class="button" style="margin: 0" onclick=""><span>적용</span></a>
                    				<c:if test="${sessionScope.mvo.memberType=='Y' }">
                    					<a href="#" class="button " style="margin: 0 0 0 5px" onclick=""><span>취소</span></a>
                    				</c:if>
                    			</td>
                    		</tr>
                    		
                    		<tr>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">RTP수립</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">0</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">10</div>
                    			</td>
                    			<td style="text-align: center;">
                    					<a href="#" class="button" style="margin: 0" onclick=""><span>적용</span></a>
                    				<c:if test="${sessionScope.mvo.memberType=='Y' }">
                    					<a href="#" class="button " style="margin: 0 0 0 5px" onclick=""><span>취소</span></a>
                    				</c:if>
                    			</td>
                    		</tr>
                    		
                    		<tr class="odd">
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">잔여위험평가</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">0</div>
                    			</td>
                    			<td style="padding-left: 10px">
                    				<div class="ellipsis"  style="width:100%;" title="">10</div>
                    			</td>
                    			<td style="text-align: center;">
                    					<a href="#" class="button" style="margin: 0" onclick=""><span>적용</span></a>
                    				<c:if test="${sessionScope.mvo.memberType=='Y' }">
                    					<a href="#" class="button " style="margin: 0 0 0 5px" onclick=""><span>취소</span></a>
                    				</c:if>
                    			</td>
                    		</tr>
                    		 --%>
                    		
                    		
                    	</c:forEach>
                    	</c:when>
                    	<c:otherwise>
                    		<tr class="odd">
								<td colspan="4" class="noDataTD">-데이터가 없습니다-</td>
							</tr>
                    	</c:otherwise>
                    	</c:choose>
      			</tbody>
      		</table>  
    		</div>
     		</form>	
  		</div><!-- end of div.box-container1 -->
</div> <!-- end of div.box -->
</body>
</html>